package com.net.shop.car.manager.api.volley.response.dingdan;

import java.math.BigDecimal;

import com.net.shop.car.manager.api.volley.Response;
import com.net.shop.car.manager.utils.Constants;
import com.net.shop.car.manager.utils.StringUtils;

public class DingdanResponse extends Response {
	// 订单状态，0代表未支付，1代表已支付，2代表当面付
	private int state;
	//订单号
	private String orderId;
	//实付总金额
	private BigDecimal money;

	/**
	 * 
	 */
	public DingdanResponse() {
		super(Constants.CREATE_DINGDAN);
	}
	
	/**
	 * @return the state
	 */
	public int getState() {
		return state;
	}

	/**
	 * @return the orderId
	 */
	public String getOrderId() {
		return orderId;
	}

	/**
	 * @return the money
	 */
	public BigDecimal getMoney() {
		return money;
	}

	@Override
	public String[] getContentTags() {
		return new String[]{"money","order_state","order_id"};
	}

	@Override
	public void parseContent(String content, int index) {
		if (index == 0) {
			money = StringUtils.filterMoneyNull(content);
		} else if (index == 1) {
			state = StringUtils.filterIntegerNull(content);
		} else if (index == 2) {
			orderId = content;
		}
	}
}
